package com.lej.my

import androidx.lifecycle.map
import com.lej.core.base.BaseModel
import com.lej.core.base.BaseViewModel
import com.lej.dataservice.club.bean.main.my.MyUserInfoAll
import com.lej.dataservice.club.http.mapLive
import com.lej.dataservice.club.http.request
import com.lej.dataservice.club.http.requestMap
import com.lej.my.http.myApiService

class MyOldViewModel : BaseViewModel<BaseModel>() {
    val userinfo = mapLive<MyUserInfoAll>()
    val balance = mapLive<Int>()
    val moneyStr = balance.map { "￥${(it?.getDataOrNull() ?: 0) / 100f}" }

    fun getBalance() {
//        requestMap(balance, { get("available_balance").asInt }) {
//            myApiService.getBalance()
//        }
    }
}